<ion-view title="验证 | 工程大电子电气学院" class="verify">
    <ion-nav-buttons side="primary">
        <button class="button button-icon button-clear icon ion-home ink ink-dark" ui-sref="app.main"></button>
    </ion-nav-buttons>
    <form name="verify" novalidate>
        
        <h4>{{subTitle}}</h4>
        <p ng-if="userdata._id">asdfsadf</p>
        <p class="msg" ng-class="{err : msg.err}" ng-if="msg.f" ng-bind-html="msg.content"></p>
        <!--input-->
        <input name="phone" placeholder="请输入您的手机号" type="text" required
               ng-model="verifyFields.phone" ng-model-options="{debounce: 500}"
               ng-pattern="/^\d+$/" ng-minlength="11" ng-maxlength="11"
               ng-if="!hasVerified" ensure-unique="mobile">

        <input class="cap-input" name="cap" placeholder="右边写了啥？→" type="text" required
               ng-model="verifyFields.cap" ng-model-options="{debounce: 500}"
               ng-minlength="4" ng-maxlength="6"
               ng-if="!hasVerified && verify.phone.$valid">

        <img ng-src={{capAddr}} alt="cap" class="cap-image" ng-if="!hasVerified && verify.phone.$valid"
             ng-click="chgCap()"/>

        <input name="code" placeholder="短信里写了啥？" type="text" required
               ng-model="verifyFields.code" ng-model-options="{debounce: 500}"
               ng-pattern="/^\d+$/" ng-minlength="6" ng-maxlength="6"
               ng-if="!hasVerified && SMSSent">


        <div class="padding" ng-if="!hasVerified">
            <button class="button button-block button-calm ink ink-dark"
                    ng-disabled="((!verify.phone.$valid || !verify.cap.$valid || !smsResendFlag) && !verify.code.$valid) || ctrl.disable" ng-click="Verify(verify.code.$valid)">
                {{verify.code.$valid ? "提交验证" : buttonSMSText}}
            </button>
        </div>

        <section ng-if="hasVerified">
            <input name="realName" placeholder="真实姓名" type="text" required
                   ng-model="psnInfoFields.realName" ng-model-options="{debounce: 500}">
            <!--<input name="sex" placeholder="性别" type="text" required
                   ng-model="psnInfoFields.sex" ng-model-options="{debounce: 500}"
                   ensure-unique>-->
            <select ng-model="psnInfoFields.sex" name="sex">
                <option value="male" selected>男</option>
                <option value="female">女</option>
            </select>

            <input name="phone2" placeholder="手机号" type="text" required
                   ng-model="verifyFields.phone" ng-model-options="{debounce: 500}"
                   ng-pattern="/^\d+$/" ng-minlength="11" ng-maxlength="11" disabled
                   >
            <input name="stdNumber" placeholder="学号" type="text" required
                   ng-model="psnInfoFields.stdNumber" ng-model-options="{debounce: 500}"
                   ng-pattern="/^\d+$/" ng-minlength="9" ng-maxlength="9"
                   ensure-unique="stdNumber">
            <!-- <input name="type" placeholder="政治面貌" type="text" required
                   ng-model="psnInfoFields.type" ng-model-options="{debounce: 500}"
                   ensure-unique>-->
            <select ng-model="psnInfoFields.type" name="type">
                <option value="league" selected>团员</option>
                <option value="party">党员</option>
                <option value="none">群众</option>
            </select>

            <div class="padding">
                <button class="button button-block button-calm ink ink-dark"
                        ng-disabled="(!verify.realName.$valid || !verify.sex.$valid || !verify.stdNumber.$valid || !verify.type.$valid) || ctrl.disable " ng-click="create()">
                    确认提交
                </button>
            </div>

        </section>

    </form>
</ion-view>